<?php
class Users extends CActiveRecord{
	
	public static function model($className = __CLASS__){
		return parent::model($className);
	}
	
	public function tableName(){
		return '{{users}}';
	}
	
	/**
	 * 验证规则
	 * @see CModel::rules()
	 */
	public function rules(){
		return array(
				array('username', 'required','message'=>'用户名不能为空'),
				array('password', 'required', 'message'=>'密码不能为空'),
				array('email', 'required', 'message'=>'邮箱不能为空'),
				array('username', 'unique', 'message'=>'用户名已经存在','on'=>'register'),
				array('email','unique','message'=>'邮箱不能为空','on'=>'register')
		);
	}
}